package org.csmzxy.class2333.instance;

public class Example15 {
    public static void main(String[]args){
        Animal animal =new Dog();
        if (animal instanceof Dog){
            Dog dog = (Dog) animal;
            dog.houseKeep();
        }else{
            System.out.println("对象类型向下转换不合法");
        }
    }
}
